import { useRoleStore } from '@/stores/role'

// 是否在黑名单
export const isDenied = (deniedRoleIds?: number[]): boolean => {
    if (!deniedRoleIds?.length) return false
    const roleStore = useRoleStore()
    return !roleStore.isSuperAdmin && !!roleStore.currentRole && deniedRoleIds.includes(roleStore.currentRole.id)
}

// 是否是当前角色
export const isRole = (roleId: number): boolean => {
    return useRoleStore().currentRole?.id === roleId
}
